import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {
  JstOtherOutEnterWarehouseOrderVO,
  JstOtherOutEnterWarehouseOrderForm,
  JstOtherOutEnterWarehouseOrderQuery
} from '@/api/jdAndJstSceneClassification/allot/jstOtherOutEnterWarehouseOrder/types';

/**
 * 查询聚水潭-其他出入库单列表
 * @param query
 * @returns {*}
 */
export const listJstOtherOutEnterWarehouseOrder = (query?: JstOtherOutEnterWarehouseOrderQuery): AxiosPromise<JstOtherOutEnterWarehouseOrderVO[]> => {
  return request({
    url: '/dataCheck/jst/otherOutEnterWarehouseOrder/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询聚水潭-其他出入库单列表
 * 01、定义后端接口
 * @param query
 * @returns {*}
 */
export const listJstOtherOutEnterWarehouseOrderByOutWareHouseType3 = (
  query?: JstOtherOutEnterWarehouseOrderQuery
): AxiosPromise<JstOtherOutEnterWarehouseOrderVO[]> => {
  return request({
    url: '/dataCheck/jst/otherOutEnterWarehouseOrder/list-by-out-warehouse-type3',
    method: 'get',
    params: query
  });
};

/**
 * 查询聚水潭-其他出入库单详细
 * @param id
 */
export const getJstOtherOutEnterWarehouseOrder = (id: string | number): AxiosPromise<JstOtherOutEnterWarehouseOrderVO> => {
  return request({
    url: '/dataCheck/jst/otherOutEnterWarehouseOrder/' + id,
    method: 'get'
  });
};

/**
 * 新增聚水潭-其他出入库单
 * @param data
 */
export const addJstOtherOutEnterWarehouseOrder = (data: JstOtherOutEnterWarehouseOrderForm) => {
  return request({
    url: '/dataCheck/jst/otherOutEnterWarehouseOrder',
    method: 'post',
    data: data
  });
};

/**
 * 修改聚水潭-其他出入库单
 * @param data
 */
export const updateJstOtherOutEnterWarehouseOrder = (data: JstOtherOutEnterWarehouseOrderForm) => {
  return request({
    url: '/dataCheck/jst/otherOutEnterWarehouseOrder',
    method: 'put',
    data: data
  });
};

/**
 * 删除聚水潭-其他出入库单
 * @param id
 */
export const delJstOtherOutEnterWarehouseOrder = (id: string | number | Array<string | number>) => {
  return request({
    url: '/dataCheck/jst/otherOutEnterWarehouseOrder/' + id,
    method: 'delete'
  });
};
